package com.acmen.easyapi.factory.impl;

import com.acmen.easyapi.annotation.ResParam;
import com.acmen.easyapi.factory.ResParamFactory;
import org.springframework.stereotype.Component;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
/**
 * @author acmen
 * @Date 2023-11-26
 */
@Component
public class DefaultResParamFactory implements ResParamFactory {
    /**
     * ResParam注解的主键ID字段
     */
    @ResParam(label = "主键ID")
    private String id;

    /**
     * 获取ResParam字段
     *
     * @return ResParam字段列表
     */
    @Override
    public List<Field> getResParamFields() {
        Field[] files = DefaultResParamFactory.class.getDeclaredFields();
        return Arrays.asList(files);
    }
}
